//
//  TalkTableViewCell.m
//  SuperNews
//
//  Created by dllo on 16/1/18.
//  Copyright © 2016年 qiang. All rights reserved.
//

#import "TalkTableViewCell.h"

@implementation TalkTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews
{
    self.backgroundColor = [UIColor whiteColor];
    self.imageV = [[UIImageView alloc] init];
    self.imageV.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.imageV];
    
    self.imageH = [[UIImageView alloc] init];
    self.imageH.backgroundColor = [UIColor yellowColor];
    self.imageH.layer.cornerRadius = 20;
    self.imageH.layer.masksToBounds = YES;
    [self.imageV addSubview:self.imageH];
    
    self.nameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.nameLabel];
    
    self.detailLabel = [[UILabel alloc] init];
    self.detailLabel.numberOfLines = 0;
    [self.contentView addSubview:self.detailLabel];
    
    self.numberLabel = [[UILabel alloc] init];
//    self.typeLabel.backgroundColor = [UIColor blueColor];
    self.numberLabel.font = [UIFont systemFontOfSize:15.0];
    [self.contentView addSubview:self.numberLabel];
    
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(120, [UIScreen mainScreen].bounds.size.height / 9.0 * 4.0 + 10, 1, [UIScreen mainScreen].bounds.size.height / 18.0 - 20)];
    view.backgroundColor = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:1.0];
    [self.contentView addSubview:view];
    
    self.typeLabel = [[UILabel alloc] init];
    self.typeLabel.font = [UIFont systemFontOfSize:15.0];
    [self.contentView addSubview:self.typeLabel];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imageV.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height / 3.0);
    self.imageH.frame = CGRectMake(20, [UIScreen mainScreen].bounds.size.height / 3.0 - 60, 40, 40);
    self.nameLabel.frame = CGRectMake(60, [UIScreen mainScreen].bounds.size.height / 3.0 - 60, 100, 40);
    self.detailLabel.frame = CGRectMake(20, [UIScreen mainScreen].bounds.size.height / 3.0, [UIScreen mainScreen].bounds.size.width - 40, [UIScreen mainScreen].bounds.size.height / 9.0);
    self.numberLabel.frame = CGRectMake(20, [UIScreen mainScreen].bounds.size.height / 9.0 * 4.0, 100, [UIScreen mainScreen].bounds.size.height / 18.0);
    self.typeLabel.frame = CGRectMake(130, [UIScreen mainScreen].bounds.size.height / 9.0 * 4.0, 100, [UIScreen mainScreen].bounds.size.height / 18.0);
}

@end
